package com.tanker.base.exception;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import com.tanker.controller.UserController;

@ControllerAdvice
public class GlobalDefaultExceptionHandler {
	private final static Logger logger = LoggerFactory.getLogger(UserController.class);

	@ExceptionHandler(value = Exception.class)
	public void defaultErrorHandler(HttpServletRequest req, Exception e) {
	// // If the exception is annotated with @ResponseStatus rethrow it and let
	// // the framework handle it - like the OrderNotFoundException example
	// // at the start of this post.
	// // AnnotationUtils is a Spring Framework utility class.
	// if (AnnotationUtils.findAnnotation(e.getClass(), ResponseStatus.class) != null)
	// throw e;
	//
	// //
		logger.error("出错",e);
	}
}
